﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace MainFrame
{
    [Serializable]
    public class CalibrationData
    {
        private int m_station;//工位选择 0-前焊接位，1-后焊接位，2-尺寸测量位
        private string m_cameraSerial;//相机序列号
        private string m_cameraSerial_full;//相机序列号+自定义名称+相机名称
        private int m_exposure;//相机曝光值
        private double m_gain;//相机增益值
        private double m_frame;//相机帧率
        private double m_imageRotateAngle;//旋转角度
        //private Mat m_originMat;//工位对应的Mat
        public int station
        {
            get { return m_station; }
            set { m_station = value; }
        }
        public string cameraSerial
        {
            get { return m_cameraSerial; }
            set { m_cameraSerial = value; }
        }
        public string cameraSerialFull
        {
            get { return m_cameraSerial_full; }
            set { m_cameraSerial_full = value; }
        }
        public int exposure
        {
            get { return m_exposure; }
            set { m_exposure = value; }
        }
        public double gain
        {
            get { return m_gain; }
            set { m_gain = value; }
        }
        public double frame 
        {
            get { return m_frame; }
            set { m_frame = value; }
        }
        public double imageRotateAngle
        {
            get { return m_imageRotateAngle; }
            set { m_imageRotateAngle = value; }
        }
        //public Mat originMat
        //{
        //    get { return m_originMat; }
        //    set { m_originMat = value; }
        //}

        private bool m_isVerticalFlip;//垂直翻转
        private bool m_isHorizontalFlip;//水平翻转

        public bool isVerticalFlip
        {
            get { return m_isVerticalFlip; }
            set { m_isVerticalFlip = value; }
        }
        public bool isHorizontalFlip
        {
            get { return m_isHorizontalFlip; }
            set { m_isHorizontalFlip = value; }
        }

        private bool m_isGrabContinual;//采集模式
        private string m_saveFilePath;//文件保存路径
        private int m_saveImageFormat;//图像保存格式

        public bool isGrabContinual
        {
            get { return m_isGrabContinual; }
            set { m_isGrabContinual = value; }
        }
        public string saveFilePath
        {
            get { return m_saveFilePath; }
            set { m_saveFilePath = value; }
        }
        public int saveImageFormat
        {
            get { return m_saveImageFormat; }
            set { m_saveImageFormat = value; }
        }

        private double m_mark1X;//mark1机械坐标X
        private double m_mark1Y;//mark1机械坐标Y
        private double m_mark2X;//mark2机械坐标X
        private double m_mark2Y;//mark2机械坐标Y

        public double mark1X
        {
            get { return m_mark1X; }
            set { m_mark1X = value; }
        }
        public double mark1Y
        {
            get { return m_mark1Y; }
            set { m_mark1Y = value; }
        }
        public double mark2X
        {
            get { return m_mark2X; }
            set { m_mark2X = value; }
        }
        public double mark2Y
        {
            get { return m_mark2Y; }
            set { m_mark2Y = value; }
        }
        private double m_calibAngle;//相机偏转角度，相对机械坐标系
        private double m_pixPerReal;//图像/实际 图像校正倍率
        private double m_imageOriginX;//图像原点X在实际坐标系中的位置
        private double m_imageOriginY;//图像原点Y在实际坐标系中的位置

        public double calibAngle
        {
            get { return m_calibAngle; }
            set { m_calibAngle = value; }
        }
        public double pixPerReal
        {
            get { return m_pixPerReal; }
            set { m_pixPerReal = value; }
        }
        public double imageOriginX
        {
            get { return m_imageOriginX; }
            set { m_imageOriginX = value; }
        }
        public double imageOriginY
        {
            get { return m_imageOriginY; }
            set { m_imageOriginY = value; }
        }
    }

    enum camStation
    {
        firstWeld=0,
        lastWeld,
        Measure
    }
    enum ImageSaveFormat
    {
        bmp=0,
        jpg,
        png,
        tiff
    }
}
